package com.restaurant.application.util.wx.templatemsg;

import com.google.common.collect.Maps;

import java.util.Map;
import java.util.Objects;

public class TemplateInfo {
    /**
     * 借出通知 模板ID
     */
    public static final String LENDING_ID = "QaeBTWGn8H0tWaJnF_kfDUqOnen92sBe_tgz437oGz8";
    /**
     * 归还提醒 模板ID
     */
    public static final String GIVE_BACK = "7H-JBqRr1j1Agu5rOY_yxObQrvMU5fw1hWd3RwE3_Ic";
    /**
     * 商品卖出 模板ID
     */
    public static final String SELL = "sHWhivyD6JRvjKa4WLdoU1TQGHL1NvHVlkb4LMQJvnc";
    /**
     * 用户审核结果 模板ID
     */
    public static final String CHECK_PASS = "f_g_5xAYt1zNzYWewxJ1DAzXItdenqx3mZVP4nI6EFM";
    /**
     * 续费成功通知 模板ID
     */
    public static final String PAY_SUCCESS = "n0m4uwuSacPw2tqIqTLz6sNSWYGQh0Vr_rHmYPZQCVc";
    /**
     * 服务到期 模板ID
     */
    public static final String SERVICE_END = "sOKrxag1mfDqBoiUddaXZOE-oZrJfOuSvNLiZ0kTdks";
    /**
     * 提醒结算 模板ID
     */
    public static final String REMIND_BILL = "g3TCUe0WmeOn_Z7S9HafQ-5AGw9hFeRo31jz8Q9qORQ";

    public static Map<String, Map<String, String>> initInfoMap(String id, String... keyword) {
        Map<String, Map<String, String>> lending = Maps.newLinkedHashMap();
        Map<String, String> forLending = Maps.newLinkedHashMap();
        if (Objects.equals(LENDING_ID, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("remark", keyword[2]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(GIVE_BACK, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("keyword3", keyword[2]);
            forLending.put("remark", keyword[3]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(SELL, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("keyword3", keyword[2]);
            forLending.put("remark", keyword[3]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(CHECK_PASS, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("remark", keyword[2]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(PAY_SUCCESS, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("keyword3", keyword[2]);
            forLending.put("remark", keyword[3]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(SERVICE_END, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("keyword3", keyword[2]);
            forLending.put("keyword4", keyword[3]);
            forLending.put("remark", keyword[4]);
            lending.put(LENDING_ID, forLending);
            return lending;
        } else if (Objects.equals(REMIND_BILL, id)) {
            forLending.put("keyword1", keyword[0]);
            forLending.put("keyword2", keyword[1]);
            forLending.put("keyword3", keyword[2]);
            forLending.put("remark", keyword[3]);
            lending.put(LENDING_ID, forLending);
            return lending;
        }
        return null;
    }
}
